<script setup>
// 导入 pinia 数据 (全局数据 哪里需要倒入即可)
import { useCounterStore } from '@/stores/counter';
import { useJokeStore } from '@/stores/joke';

// 获取数据
const store =  useCounterStore()
const text =  useJokeStore()
</script>

<template>
<h1>我的页面</h1>
<!-- 使用数据 -->
<h2>pinia数据:{{ store.count }}</h2>
<h2>doubleCount数据:{{ store.doubleCount }}</h2>
<button @click="store.increment">累加</button>

<h1>每日一笑</h1>
<p>{{ text.joke }}</p>
<button @click="text.refJoke()">刷新笑话</button>
</template>

<style scoped>

</style>
